//### 对应历史记录类型的ts类型规范 ###
//对应单个历史数据
export interface HistoryItem {
  id: string;
  title: string;
  websiteIcon: string | null;
  url: string;
  type: number;
  status: boolean;
  createBy: string;
  createTime: string;
}

export class HistoryItemImpl implements HistoryItem {
  id: string;
  title: string;
  websiteIcon: string | null;
  url: string;
  type: number;
  status: boolean;
  createBy: string;
  createTime: string;

  constructor(data: Partial<HistoryItem> = {}) {
    this.id = data.id || "";
    this.title = data.title || "";
    this.websiteIcon = data.websiteIcon || null;
    this.url = data.url || "";
    this.type = data.type || 0;
    this.status = data.status || false; // 默认值为 false
    this.createBy = data.createBy || "";
    this.createTime = data.createTime || "";
  }
}
//对应天数据
export interface DayItem {
  status: boolean;
  timeString: string;
  historyList: HistoryItemImpl[];
}

export class DayItemImpl implements DayItem {
  status: boolean;
  timeString: string;
  historyList: HistoryItem[];

  constructor(data: Partial<DayItem> = {}) {
    this.status = data.status || false; // 默认值为 false
    this.timeString = data.timeString || "";
    this.historyList = data.historyList || [];
  }
}
//对应搜索数据
export interface SearchItem {
  status: boolean;
  historyList: HistoryItemImpl[];
}

export class SearchItemImpl implements SearchItem {
  status: boolean;
  historyList: HistoryItem[];

  constructor(data: Partial<SearchItem> = {}) {
    this.status = data.status || false; // 默认值为 false
    this.historyList = data.historyList || [];
  }
}

//对应月数据
export interface MonthItem {
  timeString: string;
  dayList: DayItemImpl[];
}
//对应年数据
export interface HistoryData {
  timeString: string;
  monthList: MonthItem[];
}